package com.lyw.servlet;

import lombok.extern.log4j.Log4j2;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@Log4j2
//@WebListener
public class MyListener implements ServletContextListener {

  @Override
  public void contextInitialized(ServletContextEvent sce) {
    log.info("全局作用域执行了！");
  }

  @Override
  public void contextDestroyed(ServletContextEvent sce) {
    log.info("全局作用域销毁了！");
  }
}
